import fetch from 'common/src/utils/fetch'

const api = {
    // 查询选题列表
    getList(data) {
        return fetch({
            url: '/api/designservice/optStudentInfo/queryByPageOptStu',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查课题列表
    getSubjectList(data) {
        return fetch({
            url: '/api/designservice/optStudentInfo/queryByPageOptInfo',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 申请
    apply(data) {
        return fetch({
            url: '/api/designservice/optStudentInfo/apply',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 取消申请
    cancelApply(data) {
        return fetch({
            url: '/api/designservice/optStudentInfo/disApply',
            method: 'put',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 校验能否申请
    validateApply(data) {
        return fetch({
            url: '/api/designservice/optStudentInfo/valiApply',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查学生成绩详情列表
    getReviewList(data) {
        return fetch({
            url: '/api/designservice/resultPublish/detail',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查导师学生课题详情
    getSubjectInfo(data) {
        return fetch({
            url: '/api/designservice/optInfo/detail',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 导出
    export(data) {
        return fetch({
            url: '/api/designservice/optStudentInfo/exportList',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    getExportStatus(key) {
        return fetch({
            url: `/api/designservice/common/exportExcelResult/${key}`,
            method: 'get',
            showMask: false
        })
    },
    // 查学院
    getCollege() {
        let authId = localStorage.getItem('activeAuthId')
        return fetch({
            url: `/api/designservice/common/college?authId=${authId}`,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        })
    },
    // 根据毕业年份和学院查专业
    getSubject(data) {
        return fetch({
            url: '/api/designservice/common/findSubject',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查课题来源
    getSource(data) {
        return fetch({
            url: '/api/designservice/settingSubjectSource/queryOptionsByYear',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        });
    },
    // 查课题性质
    getNature(data) {
        return fetch({
            url: '/api/designservice/settingSubjectProperties/queryOptionsByYear',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        });
    },
    // 查社会实践
    getPractice(data) {
        return fetch({
            url: '/api/designservice/settingSubjectSociaPractice/queryOptionsByYear',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        });
    },
    // 查审核进度
    getProgress(applyNo) {
        return fetch({
            url: `/api/workflow/approval/selectApproFlow?no=${applyNo}`,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        })
    }
}

export default api
